import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import { createPinia } from 'pinia';
import router from './router';
import App from './App.vue';
import Toast from 'vue-toastification';
import 'vue-toastification/dist/index.css';
import type { ToastOptions } from 'vue-toastification/src/types';
import {  POSITION } from 'vue-toastification/src/ts/constants'
import zhCn from 'element-plus/es/locale/lang/zh-cn'; // 引入中文语言包，若要英文则用 'en'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import { setupCalendar } from 'v-calendar';
const app = createApp(App);
const pinia = createPinia();

pinia.use(piniaPluginPersistedstate);

const toastOptions: ToastOptions = {
    position: POSITION.BOTTOM_RIGHT, // 通知显示的位置，这里设置为右上角
    timeout: 3000, // 通知显示的时长，单位毫秒
    closeOnClick: true, // 点击通知时关闭通知
    pauseOnFocusLoss: true, // 失去焦点时暂停通知计时
    pauseOnHover: true, // 鼠标悬停时暂停通知计时
  };
app.use(setupCalendar, {});
app.use(ElementPlus, {
  locale: zhCn,
});
app.use(pinia);
app.use(router);
app.use(Toast, toastOptions);
app.mount('#app');